package com.wsf.swagger1.swaggerconfig.service.imp;

import com.wsf.swagger1.swaggerconfig.dao.IUser;
import com.wsf.swagger1.swaggerconfig.entity.User;
import com.wsf.swagger1.swaggerconfig.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImp implements UserService {

    @Autowired
    private IUser iUser;

    @Override
    public int insertUser(User user) {
        System.out.println(user.getAppid());
        return iUser.insertUser(user);
    }

    @Override
    public int deleteUser(int id) {
        System.out.println(id);
        return iUser.deleteUser(id);
    }

    @Override
    public int updateUser(User user) {
        System.out.println(user.getAppid());
        return iUser.updateUser(user);
    }

    @Override
    public void selectUser(int id) {
        System.out.println(id);
        List<User> userDto=iUser.selectUser(id);
        for(User user:userDto)
        {
            System.out.println(user.toString());
        }

    }
}
